package cn.wolfcode.cxf;

import cn.wolfcode.cxf.dto.User;

import javax.jws.WebService;

import java.io.UnsupportedEncodingException;

/**
 * @Author: L.Wen
 * @created_at: 2019/05/23 15:10
 */
//name暴露的服务名称, targetNamespace:命名空间,设置为接口的包名倒写(默认是本类包名倒写). endpointInterface接口地址
@WebService(name = "test", targetNamespace = "http://cxf.wolfcode.cn/", endpointInterface = "cn.wolfcode.cxf.AppService")
public class AppServiceImpl implements AppService {
    JSONResult jsonResult = JSONResult.getJsonResult();


    @Override
    public String getUserName(String id) throws UnsupportedEncodingException {
        System.out.println("===========================" + id);
        JSONResult result = JSONResult.getJsonResult();
        result.setSuccess(true);
        result.setMessage("测试姓名");
        return result.toJsonObject();
    }

    @Override
    public User getUserName2(String id) throws UnsupportedEncodingException {
        System.out.println("===========================" + id);
        return new User(1L, "测试姓名2");
    }

    @Override
    public User getUser(String id) throws UnsupportedEncodingException {
        System.out.println("===========================" + id);
        return new User(1L, "测试用户");
    }

}